part of '../index.dart';

class _UserCard extends StatelessWidget {
  const _UserCard(this.model);
  final UserSearchModel model;

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.only(bottom: 15, left: 20, right: 20),
      child: Row(
        children: [
          image(
            model.headPortraitsUrl ?? '',
            width: 40,
            height: 40,
            fit: BoxFit.fill,
          ).clipRRect(99),
          const SizedBox(width: 8),
          Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Text(
                model.nickname ?? '',
                style: const TextStyle(
                  color: Color(0xFF1B1B1B),
                  fontSize: 14,
                  fontWeight: FontWeight.w500,
                ),
              ),
              Text(
                model.userCode ?? '',
                maxLines: 1,
                style: const TextStyle(color: Color(0xFFC1C1C1), fontSize: 12),
              ),
            ],
          ).expanded
        ],
      ),
    ).onTap(() {
      Get.to(() => UserDetailsPage(userId: '${model.userId}'));
    });
  }
}
